package com.zhanshen.service.impl;

import com.zhanshen.dao.FindDao;
import com.zhanshen.dao.MessageDao;
import com.zhanshen.pojo.Find;
import com.zhanshen.pojo.Message;
import com.zhanshen.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageDao messageDao;

    @Autowired
    private FindDao findDao;
    @Override
    public int speak1(Message message) {

        Find select = findDao.select(message.getMname(), message.getMtext());
        if (select==null){
            return 0;
        }

        return messageDao.speak1(message);



    }
}
